package cn.aitrox.ry.service.config.api;

import cn.aitrox.ry.bean.CommonPageInfo;
import cn.aitrox.ry.bean.RespResult;
import cn.aitrox.ry.service.config.dto.ComponentDto;
import cn.aitrox.ry.service.config.dto.in.ComponentCreateInDto;
import cn.aitrox.ry.service.config.dto.in.ComponentEditInDto;
import cn.aitrox.ry.service.config.dto.in.ComponentSearchInDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

public interface ComponentApi {

    @PostMapping(value = "/config/component/search")
    CommonPageInfo<ComponentDto> search(@RequestBody ComponentSearchInDto input);

    @PostMapping(value = "/config/component")
    RespResult create(@RequestBody ComponentCreateInDto input);

    @PutMapping(value = "/config/component")
    RespResult edit(@RequestBody ComponentEditInDto input);

    @GetMapping(value = "/config/component/{id}")
    ComponentDto read(@PathVariable("id") Integer id);
}
